﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
using DoAnASP;
public partial class TrangChu : System.Web.UI.Page
{
    //string chuoiketnoi = ConfigurationManager.ConnectionStrings["QLBH"].ConnectionString;
    //SqlConnection ketnoi;
    //DataTable dtable1;
    //SqlDataAdapter da1;
    //DataService DB = new DataService();
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            Load_SP_top();
        }
    }
    void viewData(string sql)
    {

    }
    private void Load_SP_top()
    {
        BUS_SanPham busSP = new BUS_SanPham();
        DataTable dt = new DataTable();
        dt = busSP.LoadSP_top();
        dtlSanPham.DataSource = dt.DefaultView;
        dtlSanPham.DataBind();
    }
    protected void ImageButton4_Click(object sender, ImageClickEventArgs e)
    {
        //if (int.Parse(drl_SapXep.SelectedItem.Value) == 1)
        //{
        //    Session["orderby_Loai"] = 1;
        //    Response.Redirect("~/TrangChu.aspx");
        //}
        //if (int.Parse(drl_SapXep.SelectedItem.Value) == 2)
        //{
        //    Session["orderby_Loai"] = 2;
        //    Response.Redirect("~/TrangChu.aspx");
        //}
        //if (int.Parse(drl_SapXep.SelectedItem.Value) == 3)
        //{
        //    Session["orderby_Loai"] = 0;
        //    Response.Redirect("~/TrangChu.aspx");
        //}
    }
    protected void ImageButton11_Click(object sender, ImageClickEventArgs e)
    {
        Session["sqlseach"] = "select * from tbl_SanPham Where ID_Loai=11 and ThuongHieu=7";
        Response.Redirect("~/TimKiemSP.aspx?s=0");
    }
    protected void ibt_sony_Click(object sender, ImageClickEventArgs e)
    {
        Session["sqlseach"] = "select * from tbl_SanPham Where ID_Loai=11 and ThuongHieu=1";
        Response.Redirect("~/TimKiemSP.aspx?s=0");
    }
    protected void ibt_dell_Click(object sender, ImageClickEventArgs e)
    {
        Session["sqlseach"] = "select * from tbl_SanPham Where ID_Loai=11 and ThuongHieu=3";
        Response.Redirect("~/TimKiemSP.aspx?s=0");
    }
    protected void ibt_hp_Click(object sender, ImageClickEventArgs e)
    {
        Session["sqlseach"] = "select * from tbl_SanPham Where ID_Loai=11 and ThuongHieu=2";
        Response.Redirect("~/TimKiemSP.aspx?s=0");
    }
    protected void ibt_lenovo_Click(object sender, ImageClickEventArgs e)
    {
        Session["sqlseach"] = "select * from tbl_SanPham Where ID_Loai=11 and ThuongHieu=14";
        Response.Redirect("~/TimKiemSP.aspx?s=0");
    }
    protected void ibt_acer_Click(object sender, ImageClickEventArgs e)
    {
        Session["sqlseach"] = "select * from tbl_SanPham Where ID_Loai=11 and ThuongHieu=5";
        Response.Redirect("~/TimKiemSP.aspx?s=0");
    }
    protected void ibt_toshiba_Click(object sender, ImageClickEventArgs e)
    {
        Session["sqlseach"] = "select * from tbl_SanPham Where ID_Loai=11 and ThuongHieu=4";
        Response.Redirect("~/TimKiemSP.aspx?s=0");
    }
    protected void ibt_samsung_Click(object sender, ImageClickEventArgs e)
    {
        Session["sqlseach"] = "select * from tbl_SanPham Where ID_Loai=11 and ThuongHieu=12";
        Response.Redirect("~/TimKiemSP.aspx?s=0");
    }
}